package com.example.demo.pattern.singleton;

/**
 * 懒汉式，线程不安全
 * 是否 Lazy 初始化：是
 * 是否多线程安全：否
 * 实现难度：易
 */
public class LazyUnsafeSingleton {

    private static LazyUnsafeSingleton instance;

    private LazyUnsafeSingleton() {
    }

    public static LazyUnsafeSingleton getInstance(){
        if (instance == null){
            instance = new LazyUnsafeSingleton();
        }

        return instance;
    }
}
